<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<button>AJAX请求</button>
<script>
  const btn = document.querySelector('button');

  btn.onclick = function() {
    fetch('http://127.0.0.1:8000/fetch-serve?vip=10', {
      method: 'POST',
      headers: {
        name: 'name'
      },
      body: {
        username: 'username',
      }
    }).then(response => {
      return response.text();
    }).then(response => {
      console.log(response);
    })
  }
</script>
</body>
</html>